home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-06-30 | 2.4 KB | 76 lines |
- /*
- * %W% %E%
- *
- * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- */
- package com.sun.java.swing.event;
-
- import java.awt.event.*;
- import java.awt.*;
- import com.sun.java.swing.*;
-
- /**
- * AncestorEvent
- * <p>
- * Warning: serialized objects of this class will not be compatible with
- * future swing releases. The current serialization support is appropriate
- * for short term storage or RMI between Swing1.0 applications. It will
- * not be possible to load serialized Swing1.0 objects with future releases
- * of Swing. The JDK1.2 release of Swing will be the compatibility
- * baseline for the serialized form of Swing objects.
- *
- * @version %I% %G%
- * @author Dave Moore
- */
- public class AncestorEvent extends AWTEvent {
- public static final int ANCESTOR_ADDED = 1;
- public static final int ANCESTOR_REMOVED = 2;
- public static final int ANCESTOR_MOVED = 3;
-
- Container ancestor;
- Container ancestorParent;
-
- public AncestorEvent(JComponent source, int id, Container ancestor, Container ancestorParent) {
- super(source, id);
- this.ancestor = ancestor;
- this.ancestorParent = ancestorParent;
- }
-
- /**
- * Returns the ancestor that the event actually occured on.
- */
- public Container getAncestor() {
- return ancestor;
- }
-
- /**
- * Returns the parent of the ancestor the event actually occured on.
- * This is most interesting in an ANCESTOR_REMOVED event, as
- * the ancestor may no longer be in the component hierarchy.
- */
- public Container getAncestorParent() {
- return ancestorParent;
- }
-
- /**
- * Returns the component that the listener was added to.
- */
- public JComponent getComponent() {
- return (JComponent)getSource();
- }
- }
-